package com.mark.web.sys.entity.vo;

import com.mark.common.utils.DateTimeUtil;
import com.mark.web.sys.entity.po.Department;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description: 部门信息Vo类
 * @Author: Mark
 * @CreateDate: 2019/1/13 17:43
 * @Version: 2.0
 * @Copyright : 豆浆油条个人非正式工作室
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DeptVo {
    /**
     * 主键ID
     */
    private Integer id;

    /**
     * 部门的直接上级的部门ID
     */
    private Integer parentId;

    /**
     * 逻辑外键，关联用户表，部门负责人
     */
    private Integer leaderId;

    /**
     * 部门编号
     */
    private String number;

    /**
     * 部门名称
     */
    private String name;

    /**
     * 部门等级
     */
    private Short deptLevel;

    /**
     * 创建时间
     */
    private String createTime;

    /**
     * 最后一次修改时间
     */
    private String lastEditTime;

    public DeptVo(Department department) {
        this.id = department.getId();
        this.parentId = department.getParentId();
        this.leaderId = department.getLeaderId();
        this.number = department.getNumber();
        this.name = department.getName();
        this.deptLevel = department.getDeptLevel();
        this.createTime = DateTimeUtil.dateToStr(department.getCreateTime());
        this.lastEditTime = DateTimeUtil.dateToStr(department.getLastEditTime());
    }
}
